using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class Table1Map : EntityTypeConfiguration<Table1>
    {
        public Table1Map()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.item)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Table1");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.item).HasColumnName("item");
        }
    }
}
